// file: param.v
`ifndef CPU_PARAM
`define CPU_PARAM


    // 定义alu_op对应的常量
    // alu_op
    `define ALU_ADD     'b00000
    `define ALU_SUB     'b00001
    `define ALU_AND     'b00010
    `define ALU_OR      'b00011
    `define ALU_XOR     'b00100
    `define ALU_SLL     'b00101
    `define ALU_SRL     'b00110
    `define ALU_SRA     'b00111
    `define ALU_BEQ     'b01000
    `define ALU_BNE     'b01001
    `define ALU_BLT     'b01010
    `define ALU_BGE     'b01011
    `define ALU_JALR    'b01100
    `define ALU_SLT     'b01110
    `define ALU_SLTU    'b01111
    `define ALU_BLTU    'b10000//无符号小于跳转
    `define ALU_BGEU    'b10001//无符号大于等于跳转
    `define ALU_AUIPC   'b10010


    // opcode
    `define R_op    'b0110011
    `define I_op    'b0010011
    `define L_op   'b0000011
    `define jalr_op 'b1100111
    `define S_op    'b0100011
    `define B_op    'b1100011
    `define lui_op  'b0110111
    `define auipc_op    'b0010111
    `define jal_op   'b1101111

    //funct3
    `define f3_beq 'b000
    `define f3_bne 'b001
    `define f3_blt 'b100
    `define f3_bge 'b101


   // sext_op
        `define sext_R    'b000
        `define sext_I    'b001
        `define sext_lw   'b010
        `define sext_jalr   'b011
        `define sext_sw   'b100
        `define sext_B   'b101
        `define sext_lui   'b110
        `define sext_jal   'b111

    //Ld_op
    `define L_lw    'b000
    `define L_lh     'b001
    `define L_lb     'b010
    `define L_lhu    'b011
    `define L_lbu    'b100
    `define L_invalid 'b111

    //S_op
    `define S_sb    'b000
    `define S_sh    'b001
    `define S_sw    'b010
    `define S_invalid   'b111
        

    
   


    
`endif

